<style>
.fui-header a.back:before {
	content: " ";
	border-color: #fff;
}
.fui-cell-group .fui-cell:before {
	border-bottom: 0 solid #ebebeb;
}
.weui_cells {
    background:none
}
.weui_cells:before {
  height: 0;
  color: #fff;
}
.weui_cells:after {
  height: 0;
  border-bottom: 0 solid #D9D9D9;
}
.order-print-dots:before,.order-print-dots:after {
	content:"";
	height:0.5rem;
	width:0.5rem;
	background:#f3f3f3;
	border-radius:0.5rem;
	position:absolute;
}
.order-print-dots:before {
	left:-0.25rem;
	top:-0.25rem;
}
.order-print-dots:after {
	right:-0.25rem;
	top:-0.25rem;
}
.order-print-line {position: relative;border-bottom: 2px dashed #ddd;margin:0.25rem 0.5rem;margin-bottom:0}
</style>
<div class="fui-page order-create-page fui-page-current" ng-if="pagedata.op == 'detail'">
	<div class="fui-content" style="margin-top:0">
		<div class="fui-page-title" style="padding:0.5rem">
			<div class="syscolor bold" style="padding:0.5rem 0;font-size:1rem;">{{pagedata.item.title}}</div>
			<div ng-if="pagedata.item.descimage" class="radius" style="padding-bottom:0.2rem">
			<img ng-src="{{tomedia(pagedata.item.descimage)}}" style="width:100%"/>
			</div>
			<div class="gray" style="text-align:left;text-indent: 2em;" ng-bind-html="trust(pagedata.item.desc)"></div>
		</div>
		<div class="order-print-dots"></div>
		<div class="order-print-line"></div>
		<div class="jy-content" ng-if="pagedata.post.diyformfields.length>0">
		<div class="syscolor" style="padding:0.5rem 0;font-size:0.75rem;">基本信息</div>
		<div class="radius" style="background:#fff;margin-top:0" ng-include="sys_html('_diyform')"></div>
		<div class="order-print-dots"></div>
		<div class="order-print-line"></div>
		</div>
		<div class="jy-content">
		<div class="radius" style="background:#fff;margin-top:0.5rem" ng-include="sys_html('_ti_item')"></div>
		<div class="gray" style="padding-top:0.5rem;text-indent: 2em;" ng-bind-html="trust(pagedata.item.enddesc)"></div>
		<div class="content-empty" ng-show="!pagedata.post.content || pagedata.post.content.length == 0 ">
		  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;font-size:2rem"></i><br/><p style="color: #999;font-size: .75rem">没有任何题目！</p>
		</div>
		<div ng-show="pagedata.post.content.length >0" class="weui_btn_area">
			 <a class="weui_btn weui_btn_primary" href="javascript:"  ng-click="pagedata.checkpost=true">提交问卷</a>
		</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.checkpost" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<i class="closed icon icon-cuowu" ng-click="pagedata.checkpost=false"></i>
			<div class="weui_msg">
					<div class="weui_text_area">
						<p class="weui_msg_title">确认提交问卷？</p>
					</div>
					<div class="weui_text_area" style="padding-bottom:1rem">
						<p class="weui_msg_desc">提交问卷后，将不能再二次修改答案了！</p>
					</div>
					<div class="modal-footer">
						<div class="mod-fail" ng-click="pagedata.checkpost=false;">我再看看</div>
						<div class="mod-success" ng-click="pagedata.diyfrompost()">确认提交</div>
					</div>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.item.needdesc==1" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<div class="weui_msg">
					<div class="weui_text_area">
						<p class="weui_msg_title">{{pagedata.item.title}}</p>
					</div>
					<div class='fui-cell-group' style="padding:0 0.5rem;padding-bottom:1rem;text-align:left">
						<p class="gray" ng-bind-html="trust(pagedata.item.desc)"></p>
					</div>
					<div class="modal-footer">
						<div class="mod-check" ng-click="pagedata.item.needdesc=false;">开始答卷</div>
					</div>
			</div>
		</div>
		
	</div>
</div>
<script type="text/javascript">
scope.pagedata.diyfrompost=function(){
	var str = /^[1][3,4,5,7,8,9][0-9]{9}$/
    var strname =  /^[\u4e00-\u9fa5]+(·[\u4e00-\u9fa5]+)*$/
    var stremail = /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
    var filedata = scope.pagedata.post.diyformfields
	for (var i=0;i<filedata.length;i++){
		if((filedata[i].ismust ==1 || filedata[i].ismust ==1) && !filedata[i].data){
			console.log(filedata[i])
			scope.message(filedata[i].title +'-不能为空！','error');
			return false
		}
		if(filedata[i].type ==8 && (filedata[i].ismust ==1 || filedata[i].ismust ==1)){
			if(!(str.test(filedata[i].data))){
			  scope.message("请输入正确的手机号码！",'error')
			  return false
			}
		}
		if(filedata[i].type ==9 && (filedata[i].ismust ==1 || filedata[i].ismust ==1)){
			if(!(stremail.test(filedata[i].data))){
			  scope.message("请输入正确的邮箱！",'error')
			  return false
			}
		}
	}
	scope.post_json('/diaocha/post/',scope.pagedata.post,function(){
		
	});
}
</script>
